{include file="head.html"}
<div id="maincontent">
  <div class="wrap">
    <div class="crumbs"> <a href="__APP__/index/home">{lang='插件'}</a> <a href="#">{lang='图片轮播'}</a> </div>
    <hr />
    <div class="admin_main_function"> <a href="__URL__/adminsetting">{lang='轮播设置'}</a> </div>
    <div style="clear:both"></div>
    <form action="__URL__/add" method="post"  >
      <table class="list_table table_style">
        <tr>
          <td width="80">{lang='上传图片'}：</td>
          <td><div id="sapload" style="float:left"></div></td>
        </tr>
        <tbody id="banner_list">
          <?php if(!empty($list)) foreach($list as $vo){?>
          <tr>
            <td width="50">{lang='图片'}：</td>
            <td><img style="border:1px #ccc solid" src="[vo:url]" width="140" height="90" border="0" align="absmiddle" />&nbsp;&nbsp;&nbsp;&nbsp;
              <input style="width:160px;" class="regular-text" id="name" name="url[]" value="[vo:url]" type="text" />
              &nbsp;&nbsp;{lang='说明'}：
              <input style="width:160px;" class="regular-text" id="name" name="name[]" value="[vo:name]" type="text" />
              &nbsp;&nbsp; {lang='链接'}：
              <input style="width:160px;" class="regular-text" id="aurl" name="aurl[]" value="{$vo['aurl']}" type="text" />
              &nbsp;&nbsp; <a href="#" onclick="$(this).parent().parent().remove()">{lang='删除'}</a></td>
          </tr>
          <?php } ?>
      </table>
      <div class="submit_body">
        <button class="regular-button" type="submit" >提交</button>
      </div>
    </form>
  </div>
</div>
<script>
function add(){
	
}
function del(banner){
	$('#banner').remove();
}
</script> 
<script type="text/javascript"> 
//上传
var flashvars = {};
flashvars.types = "*.jpg;*.bmp;*.gif;*.png";
flashvars.args = "myid=111;yid=222";
flashvars.upUrl = "__APP__/upload/index";
flashvars.fileName = "Filedata";
flashvars.isGet = "1";
flashvars.maxNum = "100";
flashvars.maxSize = "{$config['accessory_size']}";
flashvars.etmsg = "1";
flashvars.ltmsg = "1";
var params = {};
params.wmode = "opaque";
var attributes = {};
swfobject.embedSWF("__PUBLICURL__/js/sapload.swf", "sapload", "450", "25", "9.0.0", "", flashvars, params, attributes);

function sapLoadMsg(t) {
	t = t.replace(/\r\n/g, "");
	var suotu = t.split('|');
	var actup = t.split('.');
	var wjlx = actup[actup.length - 1];
	switch (wjlx) {
	case 'jpg':
	case 'gif':
	case 'bmp':
	case 'png':
		var list_html = '<tr>';
	    list_html += '<td width="50">{lang='图片'}：</td>';
        list_html += '<td>';
        list_html += '<img style="border:1px #ccc solid" src="' + suotu[0] + '" width="140" height="90" border="0" align="absmiddle" />&nbsp;&nbsp;&nbsp;&nbsp;';
        list_html += '<input style="width:160px;" class="regular-text" id="name" name="url[]" value="' + suotu[0] + '" type="text" /> ';
        list_html += '&nbsp;&nbsp;{lang='说明'}：';
        list_html += '<input style="width:160px;" class="regular-text" id="name" name="name[]" type="text" />&nbsp;&nbsp;';
		list_html += '&nbsp;&nbsp;{lang='链接'}：';
        list_html += '<input style="width:160px;" class="regular-text" id="aurl" name="aurl[]" type="text" />&nbsp;&nbsp;';
        list_html += '<a href="#" onclick="$(this).parent().parent().remove()">{lang='删除'}</a></td>';
        list_html += '</tr>';
	$('#banner_list').append(list_html);
	
		parent.document.getElementById("forTriggerHide").click();
		
		
		
		 break;

	}
}
</script>
</body></html>